tools/hotplug: set mtu from bridge also on vif interface
authorOlaf Hering <olaf@aepfle.de>
Mon, 7 Feb 2011 16:55:25 +0000 (16:55 +0000)
committerOlaf Hering <olaf@aepfle.de>
Mon, 7 Feb 2011 16:55:25 +0000 (16:55 +0000)
Apply mtu size from bridge interface also in vif interface.
This depends on a kernel change which allows arbitrary mtu sizes until
the frontend driver has connected to the backend driver. Without this
kernel change, the vif mtu size will be limited to 1500 even with this
change to the vif-bridge script.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/hotplug/Linux/vif-bridge

index 1cbdd8af616ea0c17f80b5be66e83c8c0f1b22c1..14988053790cd7f5e74b8fc0bd6b9e2d81dc7b8e 100644 (file)
@@ -82,6 +82,11 @@ fi
 case "$command" in
     online)
         setup_virtual_bridge_port "$dev"
+        mtu="`ip link show $bridge | awk '/mtu/ { print $5 }'`"
+        if [ -n "$mtu" ] && [ "$mtu" -gt 0 ]
+        then
+                ip link set $dev mtu $mtu || :
+        fi
         add_to_bridge "$bridge" "$dev"
         ;;